1. Field of the Invention
The present invention relates to a circuit and a method for performing pulse width modulation, and more particularly, to a circuit and a method for performing pulse width modulation capable of improving the audio quality of pulse width modulation and the Electro-Magnetic Interference (EMI) phenomenon.
2. Description of Related Art
Pulse width modulation (PWM) is a modulation technique most commonly used in the digital circuit for processing audio signals. The so-called PWM technique adjusts a pulse width of the output audio signal by referring to an operating clock cycle that represents a PWM service rate and according to a value of the digitized audio data when generating the audio signal.
FIG. 1 is a schematic diagram of performing pulse width modulation on an audio data with 10 bits resolution. As shown in the diagram, T1 is an operating clock cycle that represents the pulse width modulation service rate, T2 is a frame cycle for PWM, and T3 is a sampling cycle of the audio signal. Since the most significant bit (MSB) of the audio data is commonly used to represent a signed value of the data, the maximum pulse width for transmitting a record of audio data (wherein, its frequency is generally referred as a frame rate for PWM), that is the frame cycle T2 is 2^9 times of T1, i.e. T2=512×T1. The pulse width for physically transmitting data depends on the value of data to be transmitted. For example, if the value of data to be transmitted is 128, the duty cycle of the pulse in a frame is 128/512, and if the value of data to be transmitted is 100, the duty cycle of the pulse in a frame is 100/512.
In addition, in order to improve the quality of transmitting the audio signal, the pulse for each record of audio data are continuously transmitted with a plurality of frames. Therefore, the sampling cycle T3 of the audio signal is integral of the frame cycle T2. Accordingly, the frequency of the operating clock for providing the PWM service rate is directly proportional to the sampling rate of the audio signal, the PWM frame rate, and the resolution of the audio data. For example, if the sampling rate of the audio signal is 12 KHz, the resolution of the audio signal is 10 bits (including a symbol representing a signed value), and the pulse for each record of the audio data are continuously transmitted with 4 frames, i.e. when the PWM frame rate is 12 KHz×4=48 KHz, the frequency of the operating clock is 48 KHz×512=24 MHz. Therefore, the frequency of the operating clock increases along with the improvement of the audio quality, i.e. the increase of the audio data resolution. As a result, the EMI phenomenon is getting worse in such case.